NOM = fimu

TEX_SOURCE = $(NOM).tex
TEX_FILES   = *.tex */*.tex ionyse.sty frontpage/report-cover.pdf images/*/*

PDFLATEX = pdflatex

all: $(NOM).pdf

$(NOM).pdf: $(TEX_SOURCE) $(TEX_FILES)
	pdflatex $<

full: clean $(TEX_SOURCE) $(TEX_FILES)
	pdflatex $(TEX_SOURCE)
	pdflatex $(TEX_SOURCE)
#	pdflatex $(TEX_SOURCE) # For the phantom sections

index:
	makeindex $(NOM).glo -s $(NOM).ist -t $(NOM).glg -o $(NOM).gls
	makeindex -s $(NOM).ist -t $(NOM).alg -o $(NOM).acn $(NOM).acr

clean:
	@rm -f *~ *.aux *.log *.toc *.lof *.lot *.ilg *.ind *.idx *.dvi *.out *.gls *.ist *.glg *,gls *.acr *.acn *.alg *.glo

real-clean:
	$(MAKE) clean
	@rm -f *.pdf *.ps *.dvi

WD = $(shell pwd)

archive:
	$(MAKE) clean
	cd ..; \
	tar jcf $(join $(WD), .tar.bz2) ./$(shell basename $(WD)); \
	tar zcf $(join $(WD), .tar.gz) ./$(shell basename $(WD)); \
	cd $(WD)
